package com.my.filters;

import javax.servlet.*;
import java.io.IOException;

public class MyFilter2 implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("Filter2 init...");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("拦截请求2...");
        filterChain.doFilter(servletRequest,servletResponse);//放行
        System.out.println("拦截响应2...");
    }

    @Override
    public void destroy() {
        System.out.println("Filter2 destroy...");
    }
}
